package com.practice.car.cardataapp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.practice.car.cardataapp.entity.SuvNationalSales;
import com.practice.car.cardataapp.entity.frontEnd.Form;
import com.practice.car.cardataapp.mapper.SuvNationalSalesDao;
import com.practice.car.cardataapp.service.SuvNationalSaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * car-data-app project
 *
 * @author ZhangMingXing
 * @date 2020/9/6
 */
@Service
public class SuvNationalSaleServiceImpl extends ServiceImpl<SuvNationalSalesDao,SuvNationalSales> implements SuvNationalSaleService {
	@Override
	public List<Form> getSeries() {
		List<SuvNationalSales> list = this.list();
		SeriesUtil<SuvNationalSales> util = new SeriesUtil<>();
		util.setLegendSolver(SuvNationalSales::getNational);
		util.setFormSolver(SuvNationalSales::getSales);
		return util.getSeries(list);
	}
}
